package com.dykj.fireFighting.server.base.bigdata.mapper;

import com.dykj.fireFighting.api.base.bigdata.device.entity.Device;
import com.dykj.fireFighting.api.base.bigdata.device.entity.DeviceElectricalVo;
import com.dykj.fireFighting.api.base.bigdata.device.vo.DeviceVo;
import com.dykj.fireFighting.api.base.devHisResult.vo.ResultVo;
import com.dykj.fireFighting.api.base.fireGroup.entity.FireGroupAndDev;
import com.dykj.fireFighting.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * @Description 设备管理-智能设备
 * @Author JacksonTu
 * @Date 2021-06-22 15:55:39
 */
public interface DeviceMapper extends SuperMapper<Device> {

    List<DeviceVo> deviceStatistics(HashMap<String, Object> params);

    List<DeviceVo> selectByUnit(@Param("unitId") String s);

    List<DeviceVo> selectByCenter(@Param("ids") List<String> ids);
    int faultRecoveryNum(@Param("ids") List<String> ids,@Param("month") String month);
    int faultEffectiveRecoveryNum(@Param("ids") List<String> ids,@Param("month") String month);
    int getFaultNum(@Param("ids") List<String> ids,@Param("month") String month);

    /**
     * 高发设备类型统计
     *
     * @param params
     * @return
     */
    List<DeviceVo> queryFaultStatistical(Map<String, Object> params);

    Device getDeviceByRelationId(String relationId);

    /**
     * 改维保端调用社会端  复制到base，
     * @param relationId
     * @return
     */
    DeviceElectricalVo getDeviceElectricalDetails(String relationId);

    List<Device> getDeviceByGroupId(String groupId);

    int getAllUnitByCount(@Param("ids") List<String> ids,@Param("begin") String begin,@Param("end") String end,@Param("o") Integer o);

    List<ResultVo> getDayByDate(@Param("unitId") String unitId,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getMonthByDate(@Param("unitId") String unitId,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getQuarterByDate(@Param("unitId") String unitId,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getYearByDate(@Param("unitId") String unitId,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getAllDay(@Param("ids") List<String> ids, @Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getAllMonth(@Param("ids") List<String> ids, @Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getAllQuarter(@Param("ids") List<String> ids, @Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<ResultVo> getAllYear(@Param("ids") List<String> ids, @Param("beginTime") String beginTime,@Param("endTime") String endTime);
}
